package ch7oopexer1;
/*飞行员做飞行测试(testFly),
驾驶客机和战斗机,只需要看起飞、降落等操作是否正常。用多态的方式实现*/

public class TestFly {
    public static void main(String[] args) {
        Plane p1 =new KeJi(10,1000,100);
        p1.run(p1);
        p1.land(p1);
        p1.show();
        KeJi k =(KeJi)p1 ;
        k.run();
        k.land();


        System.out.println("******************");
        Plane p2 =new ZhanDouJi(20,3000,50);
        p2.run(p2);
        p2.land(p2);
        p2.show();
        if(p2 instanceof ZhanDouJi){
            ZhanDouJi z = (ZhanDouJi) p2;
            z.run();
            z.land();
        }
    }
}
